// pages/product/submit.js
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		time:"请选择",
		heka:"",
		info:"",
		address:"",
		product:[
			{img:"/images/bottom6.jpg",type:"鲜花",name:"一心一意",num:1,price:195},
			{ img: "/images/bottom6.jpg", type: "鲜花", name: "一心一意", num: 1, price: 195 }
		]
	},

	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad: function (options) {
		this.gettotalprice()
	},

	/**
	 * 生命周期函数--监听页面初次渲染完成
	 */
	onReady: function () {

	},

	/**
	 * 生命周期函数--监听页面显示
	 */
	onShow: function () {

	},
	goaddress:function(){
wx.navigateTo({
	url: '/pages/myself/address/index',
})
	},
gettotalprice:function(){
	var that=this
	var temp=that.data.product
	var total=0
	for (var i = 0; i < temp.length;i++){
		total += temp[i].num * temp[i].price	
	}
	that.setData({
		totalprice: total
	})
}
})